/*
 * @Author: lucky
 * @Date: 2021-06-29 16:41:50
 * @LastEditors: wfz
 * @LastEditTime: 2021-07-03 17:26:06
 * @Description: 
 */

import Cookies from 'js-cookie';
import { tokenKey, infoKey } from './config';


export function setToken(token) {
  //  给cookie里存值，key-value的形式
  return Cookies.set(tokenKey, token);
}

//  获取token
export function getToken() {
  return Cookies.get(tokenKey);
}

// 移除token
export function removeToken() {
  Cookies.remove(tokenKey);
}


export function setinfo(data) {
  return Cookies.set(infoKey, JSON.stringify(data))
}

export function getinfo() {
  return Cookies.get(infoKey);
}

export function setId(id) {
  return Cookies.set("ID", id)
}

export function getId() {
  return Cookies.get("ID");
}
